<?php

if(!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * 首页控制器
 * @author 徐亚坤 hdyakun@sina.com
 */

class IndexController extends BaseController
{
    public function __construct()
    {
        $this->model = 'article';
        parent::__construct();
    }

    public function index()
    {
        Event::fire('after_index', $this);
        $article = new Article();
        View::make('index')
            ->with('article', $article->first())
            ->withSession(array('uid' => 1))
            ->withTitle('title')
            ->withHelloWorld('Hello World!')
            ->show();
        $view = View::make('index')
            ->with('article', $article->first())
            ->withSession(array('uid' => 1))
            ->withTitle('title')
            ->withHelloWorld('Hello World!')
            ->complete();
        echo $view;
    }
}